package com.aplikata.evok.bo;

import java.util.Date;

import com.aplikata.bo.User;

public class PatientTherapyComment implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	public static final String OPER_TIME = "operTime";
	public static final String USER_ID = "user.id";
	public static final String PATIENT_THERAPY_ID = "patientTherapy.id";

	private Long id;
	private String message;
	private Date operTime;
	private boolean readStatus;
	private PatientTherapy patientTherapy;
	private User sender;
	private User receiver;
	private boolean sendEmail;

	public static final String QY_FIND_BY_THERAPY = "PatientTherapyComment.findByTherapy";
	public static final String QY_FIND_LAST = "PatientTherapyComment.findLast";
	public static final String QY_FIND_UNREAD_COUNT = "PatientTherapyComment.findUnreadCount";
	public static final String QY_FIND_UNREAD_DOCTOR_COUNT = "PatientTherapyComment.findUnreadCountForDoctor";
	public static final String QY_FIND_UNREAD_PATIENT_COUNT = "PatientTherapyComment.findUnreadCountForPatient";

	public PatientTherapyComment() {

	}

	public PatientTherapyComment(PatientTherapy patientTherapy) {
		this.patientTherapy = patientTherapy;
	}
	
	public PatientTherapyComment(PatientTherapy patientTherapy, User sender, User receiver) {
		this.patientTherapy = patientTherapy;
		this.sender = sender;
		this.receiver = receiver;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Date getOperTime() {
		return operTime;
	}

	public void setOperTime(Date operTime) {
		this.operTime = operTime;
	}

	public PatientTherapy getPatientTherapy() {
		return patientTherapy;
	}

	public void setPatientTherapy(PatientTherapy patientTherapy) {
		this.patientTherapy = patientTherapy;
	}

	public User getSender() {
		return sender;
	}

	public void setSender(User sender) {
		this.sender = sender;
	}

	public User getReceiver() {
		return receiver;
	}

	public void setReceiver(User receiver) {
		this.receiver = receiver;
	}

	public boolean isReadStatus() {
		return readStatus;
	}

	public void setReadStatus(boolean readStatus) {
		this.readStatus = readStatus;
	}

	public boolean isSendEmail() {
		return sendEmail;
	}

	public void setSendEmail(boolean sendEmail) {
		this.sendEmail = sendEmail;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
  
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null)
			return false;
		if (!(o instanceof PatientTherapyComment))
			return false;
		if (isNew() || ((PatientTherapyComment) o).isNew())
			return false;
		else
			return getId().equals(((PatientTherapyComment) o).getId());
	}

	public boolean isNew() {
		return getId() == null;
	}
}
